<%@ Page Language="C#" Inherits="System.Web.Mvc.ViewPage<IEnumerable<TheWorldsWorst.ApiWrapper.Model.Reputation>>" %>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml" >
<head runat="server">
    <title>RepGraph</title>
    <link rel="Stylesheet" href="../../Content/Site.css" />
</head>
<body>
    <div>
        <a href="/"><img style="border-style: none" src="../../Content/img/logo.png" /></a>
    </div>
    <h1>Reputation Graph for <a href="/users/<%= ViewData["UserId"] %>"><%= ViewData["UserName"] %></a></h1>
    
    <div id="controls">
    <form method="get" action="/RepGraph/<%= ViewData["UserId"] %>">
        From: <input type="text" name="from" value="<%= ViewData["From"] %>" /><br />
        To: <input type="text" name="to" value="<%= ViewData["To"] %>" /><br />
        <input type="submit" value="View Reputation" />
    </form>
    </div>
    
    <div>
    <% foreach(var r in Model)
       { %>
        <div>
        <a href="/postredirect/<%= r.PostId %>"><%= r.Title %></a> a <%= Enum.GetName(typeof(TheWorldsWorst.StackOverflowClone.Model.PostType), r.PostType) %><br />
        <span class="rep-gain">+<%= r.Gain %></span><br />
        <span class="rep-loss">-<%= r.Loss %></span><br />
        <%= r.OnDate.ToString("dd/MM/yyyy") %>
        </div>
    <% } %>
    </div>
</body>
</html>
